From a9af70849d2d9ad2b6d2b81ba4ef4d4342bff6d8 Mon Sep 17 00:00:00 2001 From: Eshel Yaron Date: Wed, 29 May 2024 11:49:15 +0200 Subject: [PATCH] Add a couple of minibuffer completion tests Add tests for regressions that followed commit ff3f17ca3cd. See discussion here: https://lists.gnu.org/archive/html/emacs-devel/2024-05/msg00701.html * test/lisp/minibuffer-tests.el (completion-cycle) (minibuffer-next-completion): New tests. --- test/lisp/minibuffer-tests.el | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/test/lisp/minibuffer-tests.el b/test/lisp/minibuffer-tests.el index c4a7de9e51f..df36bce4634 100644 --- a/test/lisp/minibuffer-tests.el +++ b/test/lisp/minibuffer-tests.el @@ -630,5 +630,18 @@ (previous-line-completion 7) (should (equal "aa1" (get-text-property (point) 'completion--string)))))) +(ert-deftest completion-cycle () + (completing-read-with-minibuffer-setup '("aaa" "bbb" "ccc") + (let ((completion-cycle-threshold t)) + (execute-kbd-macro (kbd "TAB TAB TAB")) + (should (equal (minibuffer-contents) "ccc"))))) + +(ert-deftest minibuffer-next-completion () + (let ((default-directory (ert-resource-directory))) + (completing-read-with-minibuffer-setup #'read-file-name-internal + (insert "d/") + (execute-kbd-macro (kbd "M- M- M-")) + (should (equal "data/minibuffer-test-cttq$$tion" (minibuffer-contents)))))) + (provide 'minibuffer-tests) ;;; minibuffer-tests.el ends here -- 2.30.2